<?php

namespace app\common\model;

use think\model\concern\SoftDelete;

class PushPlan extends \think\Model
{
    use SoftDelete;

    protected $table = 'db_push_plan';

    protected $jsonAssoc = true;

    protected $autoWriteTimestamp = true;

    protected $schema = [
        'id' => 'int',
        'create_time' => 'int',
        'update_time' => 'int',
        'delete_time' => 'int',
        'pubid' => 'varchar',
        'sort' => 'int',
        'name' => 'varchar',
        'member_id' => 'int',
        'article_class_id' => 'int',
        'img_class_id' => 'int',
        'site_id' => 'int',
        'site_cat_id' => 'int',
        'is_insert_picture' => 'tinyint',
        'minute' => 'varchar',
        'hour' => 'varchar',
        'day' => 'varchar',
        'month' => 'varchar',
        'week' => 'varchar',
        'number_of_articles' => 'int',
        'is_open' => 'tinyint',
        'period' => 'tinyint',
        'img_line' => 'tinyint',
        'is_relation' => 'tinyint',
        'relation_num' => 'varchar',
        'relation_title' => 'varchar',
        'sent_today' => 'int',
        'time_gap' => 'varchar',
    ];

    public $getters = [
        
    ];

    /**
     * 关联模型pushLog
     */
    public function pushLog()
    {
        return $this->hasMany(PushLog::class );
    }

    /**
     * 关联模型member
     */
    public function member()
    {
        return $this->belongsTo(Member::class );
    }

    /**
     * 关联模型articleClass
     */
    public function articleClass()
    {
        return $this->belongsTo(ArticleClass::class );
    }

    /**
     * 关联模型imgClass
     */
    public function imgClass()
    {
        return $this->belongsTo(ImgClass::class );
    }

    /**
     * 关联模型site
     */
    public function site()
    {
        return $this->belongsTo(Site::class );
    }
}
